<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# OPTIONS_GHC -O2 #-}</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- We always optimise this, otherwise performance of a non-optimised</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- compiler is severely affected</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- (c) The University of Glasgow, 1997-2006</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Character encodings</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Utils.Encoding</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><span class="hs-comment">-- * UTF-8</span></span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeCharAddr%23"><span class="hs-identifier">utf8DecodeCharAddr#</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8PrevChar"><span class="hs-identifier">utf8PrevChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8CharStart"><span class="hs-identifier">utf8CharStart</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeChar"><span class="hs-identifier">utf8DecodeChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeByteString"><span class="hs-identifier">utf8DecodeByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8UnconsByteString"><span class="hs-identifier">utf8UnconsByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeShortByteString"><span class="hs-identifier">utf8DecodeShortByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeStringLazy"><span class="hs-identifier">utf8DecodeStringLazy</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8EncodeChar"><span class="hs-identifier">utf8EncodeChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8EncodeString"><span class="hs-identifier">utf8EncodeString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8EncodeShortByteString"><span class="hs-identifier">utf8EncodeShortByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8EncodedLength"><span class="hs-identifier">utf8EncodedLength</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#countUTF8Chars"><span class="hs-identifier">countUTF8Chars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Z-encoding</span></span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#zEncodeString"><span class="hs-identifier">zEncodeString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier">zDecodeString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Base62-encoding</span></span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#toBase62"><span class="hs-identifier">toBase62</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="GHC.Utils.Encoding.html#toBase62Padded"><span class="hs-identifier">toBase62Padded</span></a></span><span>
</span><span id="line-37"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.html#"><span class="hs-identifier">Foreign</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.ForeignPtr.Unsafe.html#"><span class="hs-identifier">Foreign.ForeignPtr.Unsafe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.ForeignPtr.html#unsafeForeignPtrToPtr"><span class="hs-identifier">unsafeForeignPtrToPtr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Char.html#"><span class="hs-identifier">Data.Char</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Char.html#"><span class="hs-identifier">Data.Char</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Char</span></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Numeric.html#"><span class="hs-identifier">Numeric</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#"><span class="hs-identifier">GHC.IO</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#"><span class="hs-identifier">GHC.ST</span></a></span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#"><span class="hs-identifier">Data.ByteString.Internal</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS</span></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#"><span class="hs-identifier">Data.ByteString.Short.Internal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier">ShortByteString</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exts.html#"><span class="hs-identifier">GHC.Exts</span></a></span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-56"></span><span class="hs-comment">-- UTF-8</span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span class="hs-comment">-- We can't write the decoder as efficiently as we'd like without</span><span>
</span><span id="line-59"></span><span class="hs-comment">-- resorting to unboxed extensions, unfortunately.  I tried to write</span><span>
</span><span id="line-60"></span><span class="hs-comment">-- an IO version of this function, but GHC can't eliminate boxed</span><span>
</span><span id="line-61"></span><span class="hs-comment">-- results from an IO-returning function.</span><span>
</span><span id="line-62"></span><span class="hs-comment">--</span><span>
</span><span id="line-63"></span><span class="hs-comment">-- We assume we can ignore overflow when parsing a multibyte character here.</span><span>
</span><span id="line-64"></span><span class="hs-comment">-- To make this safe, we add extra sentinel bytes to unparsed UTF-8 sequences</span><span>
</span><span id="line-65"></span><span class="hs-comment">-- before decoding them (see &quot;GHC.Data.StringBuffer&quot;).</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeChar%23"><span class="hs-pragma hs-type">utf8DecodeChar#</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-68"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeChar%23"><span class="hs-identifier hs-type">utf8DecodeChar#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word#</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char#</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-69"></span><span id="utf8DecodeChar%23"><span class="annot"><span class="annottext">utf8DecodeChar# :: (Int# -&gt; Word#) -&gt; (# Char#, Int# #)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeChar%23"><span class="hs-identifier hs-var hs-var">utf8DecodeChar#</span></a></span></span><span> </span><span id="local-6989586621680777039"><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><a href="#local-6989586621680777039"><span class="hs-identifier hs-var">indexWord8#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-70"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680777038"><span class="annot"><span class="annottext">ch0 :: Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var hs-var">ch0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Int#
</span><span class="hs-identifier hs-var">word2Int#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><a href="#local-6989586621680777039"><span class="hs-identifier hs-var">indexWord8#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-71"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-72"></span><span>    </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x7F#</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Char#
</span><span class="hs-identifier hs-var">chr#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xC0#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`andI#`</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xDF#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-75"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680777036"><span class="annot"><span class="annottext">ch1 :: Int#
</span><a href="#local-6989586621680777036"><span class="hs-identifier hs-var hs-var">ch1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Int#
</span><span class="hs-identifier hs-var">word2Int#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><a href="#local-6989586621680777039"><span class="hs-identifier hs-var">indexWord8#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-76"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777036"><span class="hs-identifier hs-var">ch1</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`orI#`</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777036"><span class="hs-identifier hs-var">ch1</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xC0#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; (# Char#, Int# #)
</span><a href="#local-6989586621680777035"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-77"></span><span>        </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Char#
</span><span class="hs-identifier hs-var">chr#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">-#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xC0#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`uncheckedIShiftL#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">6#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span>
</span><span id="line-78"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777036"><span class="hs-identifier hs-var">ch1</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">-#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-79"></span><span>           </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">2#</span></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xE0#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`andI#`</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xEF#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-82"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680777034"><span class="annot"><span class="annottext">ch1 :: Int#
</span><a href="#local-6989586621680777034"><span class="hs-identifier hs-var hs-var">ch1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Int#
</span><span class="hs-identifier hs-var">word2Int#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><a href="#local-6989586621680777039"><span class="hs-identifier hs-var">indexWord8#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-83"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777034"><span class="hs-identifier hs-var">ch1</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`orI#`</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777034"><span class="hs-identifier hs-var">ch1</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xC0#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; (# Char#, Int# #)
</span><a href="#local-6989586621680777035"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-84"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680777033"><span class="annot"><span class="annottext">ch2 :: Int#
</span><a href="#local-6989586621680777033"><span class="hs-identifier hs-var hs-var">ch2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Int#
</span><span class="hs-identifier hs-var">word2Int#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><a href="#local-6989586621680777039"><span class="hs-identifier hs-var">indexWord8#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">2#</span></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-85"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777033"><span class="hs-identifier hs-var">ch2</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`orI#`</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777033"><span class="hs-identifier hs-var">ch2</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xC0#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; (# Char#, Int# #)
</span><a href="#local-6989586621680777035"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">2#</span></span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-86"></span><span>        </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Char#
</span><span class="hs-identifier hs-var">chr#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">-#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xE0#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`uncheckedIShiftL#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">12#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span>
</span><span id="line-87"></span><span>                 </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777034"><span class="hs-identifier hs-var">ch1</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">-#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`uncheckedIShiftL#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">6#</span></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span>
</span><span id="line-88"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777033"><span class="hs-identifier hs-var">ch2</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">-#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-89"></span><span>           </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">3#</span></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xF0#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`andI#`</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xF8#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-92"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680777032"><span class="annot"><span class="annottext">ch1 :: Int#
</span><a href="#local-6989586621680777032"><span class="hs-identifier hs-var hs-var">ch1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Int#
</span><span class="hs-identifier hs-var">word2Int#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><a href="#local-6989586621680777039"><span class="hs-identifier hs-var">indexWord8#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-93"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777032"><span class="hs-identifier hs-var">ch1</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`orI#`</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777032"><span class="hs-identifier hs-var">ch1</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xC0#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; (# Char#, Int# #)
</span><a href="#local-6989586621680777035"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-94"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680777031"><span class="annot"><span class="annottext">ch2 :: Int#
</span><a href="#local-6989586621680777031"><span class="hs-identifier hs-var hs-var">ch2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Int#
</span><span class="hs-identifier hs-var">word2Int#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><a href="#local-6989586621680777039"><span class="hs-identifier hs-var">indexWord8#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">2#</span></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-95"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777031"><span class="hs-identifier hs-var">ch2</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`orI#`</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777031"><span class="hs-identifier hs-var">ch2</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xC0#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; (# Char#, Int# #)
</span><a href="#local-6989586621680777035"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">2#</span></span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-96"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680777030"><span class="annot"><span class="annottext">ch3 :: Int#
</span><a href="#local-6989586621680777030"><span class="hs-identifier hs-var hs-var">ch3</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Int#
</span><span class="hs-identifier hs-var">word2Int#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><a href="#local-6989586621680777039"><span class="hs-identifier hs-var">indexWord8#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">3#</span></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-97"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777030"><span class="hs-identifier hs-var">ch3</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`orI#`</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777030"><span class="hs-identifier hs-var">ch3</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xC0#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; (# Char#, Int# #)
</span><a href="#local-6989586621680777035"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">3#</span></span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-98"></span><span>        </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Char#
</span><span class="hs-identifier hs-var">chr#</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777038"><span class="hs-identifier hs-var">ch0</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">-#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0xF0#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`uncheckedIShiftL#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">18#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span>
</span><span id="line-99"></span><span>                 </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777032"><span class="hs-identifier hs-var">ch1</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">-#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`uncheckedIShiftL#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">12#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span>
</span><span id="line-100"></span><span>                 </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777031"><span class="hs-identifier hs-var">ch2</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">-#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`uncheckedIShiftL#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">6#</span></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span>
</span><span id="line-101"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777030"><span class="hs-identifier hs-var">ch3</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">-#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x80#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-102"></span><span>           </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">4#</span></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; (# Char#, Int# #)
</span><a href="#local-6989586621680777035"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span>
</span><span id="line-105"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-106"></span><span>        </span><span class="hs-comment">-- all invalid sequences end up here:</span><span>
</span><span id="line-107"></span><span>        </span><span class="annot"><a href="#local-6989586621680777035"><span class="hs-identifier hs-type">fail</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char#</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-108"></span><span>        </span><span id="local-6989586621680777035"><span class="annot"><span class="annottext">fail :: Int# -&gt; (# Char#, Int# #)
</span><a href="#local-6989586621680777035"><span class="hs-identifier hs-var hs-var">fail</span></a></span></span><span> </span><span id="local-6989586621680777029"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777029"><span class="hs-identifier hs-var">nBytes#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">Char#
</span><span class="hs-char">'\0'#</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777029"><span class="hs-identifier hs-var">nBytes#</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-109"></span><span>        </span><span class="hs-comment">-- '\xFFFD' would be the usual replacement character, but</span><span>
</span><span id="line-110"></span><span>        </span><span class="hs-comment">-- that's a valid symbol in Haskell, so will result in a</span><span>
</span><span id="line-111"></span><span>        </span><span class="hs-comment">-- confusing parse error later on.  Instead we use '\0' which</span><span>
</span><span id="line-112"></span><span>        </span><span class="hs-comment">-- will signal a lexer error immediately.</span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeCharAddr%23"><span class="hs-identifier hs-type">utf8DecodeCharAddr#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Addr#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char#</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-115"></span><span id="utf8DecodeCharAddr%23"><span class="annot"><span class="annottext">utf8DecodeCharAddr# :: Addr# -&gt; Int# -&gt; (# Char#, Int# #)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeCharAddr%23"><span class="hs-identifier hs-var hs-var">utf8DecodeCharAddr#</span></a></span></span><span> </span><span id="local-6989586621680777028"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680777028"><span class="hs-identifier hs-var">a#</span></a></span></span><span> </span><span id="local-6989586621680777027"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777027"><span class="hs-identifier hs-var">off#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-116"></span><span>    </span><span class="annot"><span class="annottext">(Int# -&gt; Word#) -&gt; (# Char#, Int# #)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeChar%23"><span class="hs-identifier hs-var">utf8DecodeChar#</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680777026"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777026"><span class="hs-identifier hs-var">i#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; Int# -&gt; Word#
</span><span class="hs-identifier hs-var">indexWord8OffAddr#</span></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680777028"><span class="hs-identifier hs-var">a#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777026"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777027"><span class="hs-identifier hs-var">off#</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeCharByteArray%23"><span class="hs-identifier hs-type">utf8DecodeCharByteArray#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">ByteArray#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char#</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-119"></span><span id="utf8DecodeCharByteArray%23"><span class="annot"><span class="annottext">utf8DecodeCharByteArray# :: ByteArray# -&gt; Int# -&gt; (# Char#, Int# #)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeCharByteArray%23"><span class="hs-identifier hs-var hs-var">utf8DecodeCharByteArray#</span></a></span></span><span> </span><span id="local-6989586621680777024"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680777024"><span class="hs-identifier hs-var">ba#</span></a></span></span><span> </span><span id="local-6989586621680777023"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777023"><span class="hs-identifier hs-var">off#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-120"></span><span>    </span><span class="annot"><span class="annottext">(Int# -&gt; Word#) -&gt; (# Char#, Int# #)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeChar%23"><span class="hs-identifier hs-var">utf8DecodeChar#</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680777022"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777022"><span class="hs-identifier hs-var">i#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; Int# -&gt; Word#
</span><span class="hs-identifier hs-var">indexWord8Array#</span></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680777024"><span class="hs-identifier hs-var">ba#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777022"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777023"><span class="hs-identifier hs-var">off#</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeChar"><span class="hs-identifier hs-type">utf8DecodeChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span id="utf8DecodeChar"><span class="annot"><span class="annottext">utf8DecodeChar :: Ptr Word8 -&gt; (Char, Int)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeChar"><span class="hs-identifier hs-var hs-var">utf8DecodeChar</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621680777020"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680777020"><span class="hs-identifier hs-var">a#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-124"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; Int# -&gt; (# Char#, Int# #)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeCharAddr%23"><span class="hs-identifier hs-var">utf8DecodeCharAddr#</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680777020"><span class="hs-identifier hs-var">a#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-125"></span><span>    </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680777019"><span class="annot"><span class="annottext">Char#
</span><a href="#local-6989586621680777019"><span class="hs-identifier hs-var">c#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680777018"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777018"><span class="hs-identifier hs-var">nBytes#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">Char# -&gt; Char
</span><span class="hs-identifier hs-var">C#</span></span><span> </span><span class="annot"><span class="annottext">Char#
</span><a href="#local-6989586621680777019"><span class="hs-identifier hs-var">c#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><span class="hs-identifier hs-var">I#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680777018"><span class="hs-identifier hs-var">nBytes#</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span class="hs-comment">-- UTF-8 is cleverly designed so that we can always figure out where</span><span>
</span><span id="line-128"></span><span class="hs-comment">-- the start of the current character is, given any position in a</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- stream.  This function finds the start of the previous character,</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- assuming there *is* a previous character.</span><span>
</span><span id="line-131"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8PrevChar"><span class="hs-identifier hs-type">utf8PrevChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-132"></span><span id="utf8PrevChar"><span class="annot"><span class="annottext">utf8PrevChar :: Ptr Word8 -&gt; IO (Ptr Word8)
</span><a href="GHC.Utils.Encoding.html#utf8PrevChar"><span class="hs-identifier hs-var hs-var">utf8PrevChar</span></a></span></span><span> </span><span id="local-6989586621680777017"><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680777017"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; IO (Ptr Word8)
</span><a href="GHC.Utils.Encoding.html#utf8CharStart"><span class="hs-identifier hs-var">utf8CharStart</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680777017"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8CharStart"><span class="hs-identifier hs-type">utf8CharStart</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-135"></span><span id="utf8CharStart"><span class="annot"><span class="annottext">utf8CharStart :: Ptr Word8 -&gt; IO (Ptr Word8)
</span><a href="GHC.Utils.Encoding.html#utf8CharStart"><span class="hs-identifier hs-var hs-var">utf8CharStart</span></a></span></span><span> </span><span id="local-6989586621680777015"><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680777015"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; IO (Ptr Word8)
forall {b}. (Storable b, Ord b, Num b) =&gt; Ptr b -&gt; IO (Ptr b)
</span><a href="#local-6989586621680777014"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680777015"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-136"></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680777014"><span class="annot"><span class="annottext">go :: Ptr b -&gt; IO (Ptr b)
</span><a href="#local-6989586621680777014"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621680777001"><span class="annot"><span class="annottext">Ptr b
</span><a href="#local-6989586621680777001"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621680777000"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680777000"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ptr b -&gt; IO b
forall a. Storable a =&gt; Ptr a -&gt; IO a
</span><a href="../../base/src/Foreign.Storable.html#peek"><span class="hs-identifier hs-var">peek</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr b
</span><a href="#local-6989586621680777001"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-137"></span><span>                 </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680777000"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">b
</span><span class="hs-number">0x80</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680777000"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">b
</span><span class="hs-number">0xC0</span></span><span>
</span><span id="line-138"></span><span>                        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Ptr b -&gt; IO (Ptr b)
</span><a href="#local-6989586621680777014"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr b
</span><a href="#local-6989586621680777001"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr b -&gt; Int -&gt; Ptr b
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>                        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Ptr b -&gt; IO (Ptr b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr b
</span><a href="#local-6989586621680777001"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeLazy%23"><span class="hs-pragma hs-type">utf8DecodeLazy#</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-142"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeLazy%23"><span class="hs-identifier hs-type">utf8DecodeLazy#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char#</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-special">#)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">]</span><span>
</span><span id="line-143"></span><span id="utf8DecodeLazy%23"><span class="annot"><span class="annottext">utf8DecodeLazy# :: IO () -&gt; (Int# -&gt; (# Char#, Int# #)) -&gt; Int# -&gt; IO [Char]
</span><a href="GHC.Utils.Encoding.html#utf8DecodeLazy%23"><span class="hs-identifier hs-var hs-var">utf8DecodeLazy#</span></a></span></span><span> </span><span id="local-6989586621680776995"><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621680776995"><span class="hs-identifier hs-var">retain</span></a></span></span><span> </span><span id="local-6989586621680776994"><span class="annot"><span class="annottext">Int# -&gt; (# Char#, Int# #)
</span><a href="#local-6989586621680776994"><span class="hs-identifier hs-var">decodeChar#</span></a></span></span><span> </span><span id="local-6989586621680776993"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776993"><span class="hs-identifier hs-var">len#</span></a></span></span><span>
</span><span id="line-144"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; IO [Char]
</span><a href="#local-6989586621680776992"><span class="hs-identifier hs-var">unpack</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span>
</span><span id="line-145"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-146"></span><span>    </span><span id="local-6989586621680776992"><span class="annot"><span class="annottext">unpack :: Int# -&gt; IO [Char]
</span><a href="#local-6989586621680776992"><span class="hs-identifier hs-var hs-var">unpack</span></a></span></span><span> </span><span id="local-6989586621680776987"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776987"><span class="hs-identifier hs-var">i#</span></a></span></span><span>
</span><span id="line-147"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776987"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776993"><span class="hs-identifier hs-var">len#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621680776995"><span class="hs-identifier hs-var">retain</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO [Char] -&gt; IO [Char]
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO [Char]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-148"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-149"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; (# Char#, Int# #)
</span><a href="#local-6989586621680776994"><span class="hs-identifier hs-var">decodeChar#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776987"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-150"></span><span>              </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680776986"><span class="annot"><span class="annottext">Char#
</span><a href="#local-6989586621680776986"><span class="hs-identifier hs-var">c#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776985"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776985"><span class="hs-identifier hs-var">nBytes#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-151"></span><span>                </span><span id="local-6989586621680776984"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776984"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO [Char] -&gt; IO [Char]
forall a. IO a -&gt; IO a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupableInterleaveIO"><span class="hs-identifier hs-var">unsafeDupableInterleaveIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [Char] -&gt; IO [Char]) -&gt; IO [Char] -&gt; IO [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; IO [Char]
</span><a href="#local-6989586621680776992"><span class="hs-identifier hs-var">unpack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776987"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776985"><span class="hs-identifier hs-var">nBytes#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>                </span><span class="annot"><span class="annottext">[Char] -&gt; IO [Char]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char# -&gt; Char
</span><span class="hs-identifier hs-var">C#</span></span><span> </span><span class="annot"><span class="annottext">Char#
</span><a href="#local-6989586621680776986"><span class="hs-identifier hs-var">c#</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776984"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeByteString"><span class="hs-identifier hs-type">utf8DecodeByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">]</span><span>
</span><span id="line-155"></span><span id="utf8DecodeByteString"><span class="annot"><span class="annottext">utf8DecodeByteString :: ByteString -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#utf8DecodeByteString"><span class="hs-identifier hs-var hs-var">utf8DecodeByteString</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#PS"><span class="hs-identifier hs-type">BS.PS</span></a></span><span> </span><span id="local-6989586621680776981"><span class="annot"><span class="annottext">ForeignPtr Word8
</span><a href="#local-6989586621680776981"><span class="hs-identifier hs-var">fptr</span></a></span></span><span> </span><span id="local-6989586621680776980"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776980"><span class="hs-identifier hs-var">offset</span></a></span></span><span> </span><span id="local-6989586621680776979"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776979"><span class="hs-identifier hs-var">len</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ForeignPtr Word8 -&gt; Int -&gt; Int -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#utf8DecodeStringLazy"><span class="hs-identifier hs-var">utf8DecodeStringLazy</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignPtr Word8
</span><a href="#local-6989586621680776981"><span class="hs-identifier hs-var">fptr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776980"><span class="hs-identifier hs-var">offset</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776979"><span class="hs-identifier hs-var">len</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8UnconsByteString"><span class="hs-identifier hs-type">utf8UnconsByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-159"></span><span id="utf8UnconsByteString"><span class="annot"><span class="annottext">utf8UnconsByteString :: ByteString -&gt; Maybe (Char, ByteString)
</span><a href="GHC.Utils.Encoding.html#utf8UnconsByteString"><span class="hs-identifier hs-var hs-var">utf8UnconsByteString</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#PS"><span class="hs-identifier hs-type">BS.PS</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignPtr Word8
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Char, ByteString)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-160"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8UnconsByteString"><span class="hs-identifier hs-var">utf8UnconsByteString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#PS"><span class="hs-identifier hs-type">BS.PS</span></a></span><span> </span><span id="local-6989586621680776978"><span class="annot"><span class="annottext">ForeignPtr Word8
</span><a href="#local-6989586621680776978"><span class="hs-identifier hs-var">fptr</span></a></span></span><span> </span><span id="local-6989586621680776977"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776977"><span class="hs-identifier hs-var">offset</span></a></span></span><span> </span><span id="local-6989586621680776976"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776976"><span class="hs-identifier hs-var">len</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-161"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO (Maybe (Char, ByteString)) -&gt; Maybe (Char, ByteString)
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupablePerformIO"><span class="hs-identifier hs-var">unsafeDupablePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe (Char, ByteString)) -&gt; Maybe (Char, ByteString))
-&gt; IO (Maybe (Char, ByteString)) -&gt; Maybe (Char, ByteString)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-162"></span><span>      </span><span class="annot"><span class="annottext">ForeignPtr Word8
-&gt; (Ptr Word8 -&gt; IO (Maybe (Char, ByteString)))
-&gt; IO (Maybe (Char, ByteString))
forall a b. ForeignPtr a -&gt; (Ptr a -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/GHC.ForeignPtr.html#withForeignPtr"><span class="hs-identifier hs-var">withForeignPtr</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignPtr Word8
</span><a href="#local-6989586621680776978"><span class="hs-identifier hs-var">fptr</span></a></span><span> </span><span class="annot"><span class="annottext">((Ptr Word8 -&gt; IO (Maybe (Char, ByteString)))
 -&gt; IO (Maybe (Char, ByteString)))
-&gt; (Ptr Word8 -&gt; IO (Maybe (Char, ByteString)))
-&gt; IO (Maybe (Char, ByteString))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680776973"><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680776973"><span class="hs-identifier hs-var">ptr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-163"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776972"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776972"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680776971"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776971"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; (Char, Int)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeChar"><span class="hs-identifier hs-var">utf8DecodeChar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680776973"><span class="hs-identifier hs-var">ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Word8
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776977"><span class="hs-identifier hs-var">offset</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span>        </span><span class="annot"><span class="annottext">Maybe (Char, ByteString) -&gt; IO (Maybe (Char, ByteString))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Char, ByteString) -&gt; IO (Maybe (Char, ByteString)))
-&gt; Maybe (Char, ByteString) -&gt; IO (Maybe (Char, ByteString))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Char, ByteString) -&gt; Maybe (Char, ByteString)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776972"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignPtr Word8 -&gt; Int -&gt; Int -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Internal.html#PS"><span class="hs-identifier hs-var">BS.PS</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignPtr Word8
</span><a href="#local-6989586621680776978"><span class="hs-identifier hs-var">fptr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776977"><span class="hs-identifier hs-var">offset</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776971"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776976"><span class="hs-identifier hs-var">len</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776971"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeStringLazy"><span class="hs-identifier hs-type">utf8DecodeStringLazy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.ForeignPtr.html#ForeignPtr"><span class="hs-identifier hs-type">ForeignPtr</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">]</span><span>
</span><span id="line-167"></span><span id="utf8DecodeStringLazy"><span class="annot"><span class="annottext">utf8DecodeStringLazy :: ForeignPtr Word8 -&gt; Int -&gt; Int -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#utf8DecodeStringLazy"><span class="hs-identifier hs-var hs-var">utf8DecodeStringLazy</span></a></span></span><span> </span><span id="local-6989586621680776969"><span class="annot"><span class="annottext">ForeignPtr Word8
</span><a href="#local-6989586621680776969"><span class="hs-identifier hs-var">fp</span></a></span></span><span> </span><span id="local-6989586621680776968"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776968"><span class="hs-identifier hs-var">offset</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680776967"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776967"><span class="hs-identifier hs-var">len#</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO [Char] -&gt; [Char]
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupablePerformIO"><span class="hs-identifier hs-var">unsafeDupablePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [Char] -&gt; [Char]) -&gt; IO [Char] -&gt; [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-169"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621680776966"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680776966"><span class="hs-identifier hs-var">a#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ForeignPtr Word8 -&gt; Ptr Word8
forall a. ForeignPtr a -&gt; Ptr a
</span><a href="../../base/src/GHC.ForeignPtr.html#unsafeForeignPtrToPtr"><span class="hs-identifier hs-var">unsafeForeignPtrToPtr</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignPtr Word8
</span><a href="#local-6989586621680776969"><span class="hs-identifier hs-var">fp</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Ptr Any
forall a b. Ptr a -&gt; Int -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#plusPtr"><span class="hs-operator hs-var">`plusPtr`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776968"><span class="hs-identifier hs-var">offset</span></a></span><span>
</span><span id="line-170"></span><span>      </span><span class="annot"><span class="annottext">IO () -&gt; (Int# -&gt; (# Char#, Int# #)) -&gt; Int# -&gt; IO [Char]
</span><a href="GHC.Utils.Encoding.html#utf8DecodeLazy%23"><span class="hs-identifier hs-var">utf8DecodeLazy#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ForeignPtr Word8 -&gt; IO ()
forall a. ForeignPtr a -&gt; IO ()
</span><a href="../../base/src/GHC.ForeignPtr.html#touchForeignPtr"><span class="hs-identifier hs-var">touchForeignPtr</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignPtr Word8
</span><a href="#local-6989586621680776969"><span class="hs-identifier hs-var">fp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; Int# -&gt; (# Char#, Int# #)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeCharAddr%23"><span class="hs-identifier hs-var">utf8DecodeCharAddr#</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680776966"><span class="hs-identifier hs-var">a#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776967"><span class="hs-identifier hs-var">len#</span></a></span><span>
</span><span id="line-171"></span><span class="hs-comment">-- Note that since utf8DecodeLazy# returns a thunk the lifetime of the</span><span>
</span><span id="line-172"></span><span class="hs-comment">-- ForeignPtr actually needs to be longer than the lexical lifetime</span><span>
</span><span id="line-173"></span><span class="hs-comment">-- withForeignPtr would provide here. That's why we use touchForeignPtr to</span><span>
</span><span id="line-174"></span><span class="hs-comment">-- keep the fp alive until the last character has actually been decoded.</span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8DecodeShortByteString"><span class="hs-identifier hs-type">utf8DecodeShortByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">]</span><span>
</span><span id="line-177"></span><span id="utf8DecodeShortByteString"><span class="annot"><span class="annottext">utf8DecodeShortByteString :: ShortByteString -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#utf8DecodeShortByteString"><span class="hs-identifier hs-var hs-var">utf8DecodeShortByteString</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#SBS"><span class="hs-identifier hs-type">SBS</span></a></span><span> </span><span id="local-6989586621680776963"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680776963"><span class="hs-identifier hs-var">ba#</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-178"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO [Char] -&gt; [Char]
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupablePerformIO"><span class="hs-identifier hs-var">unsafeDupablePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [Char] -&gt; [Char]) -&gt; IO [Char] -&gt; [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-179"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680776962"><span class="annot"><span class="annottext">len# :: Int#
</span><a href="#local-6989586621680776962"><span class="hs-identifier hs-var hs-var">len#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; Int#
</span><span class="hs-identifier hs-var">sizeofByteArray#</span></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680776963"><span class="hs-identifier hs-var">ba#</span></a></span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-180"></span><span>      </span><span class="annot"><span class="annottext">IO () -&gt; (Int# -&gt; (# Char#, Int# #)) -&gt; Int# -&gt; IO [Char]
</span><a href="GHC.Utils.Encoding.html#utf8DecodeLazy%23"><span class="hs-identifier hs-var">utf8DecodeLazy#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteArray# -&gt; Int# -&gt; (# Char#, Int# #)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeCharByteArray%23"><span class="hs-identifier hs-var">utf8DecodeCharByteArray#</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680776963"><span class="hs-identifier hs-var">ba#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776962"><span class="hs-identifier hs-var">len#</span></a></span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="annot"><a href="GHC.Utils.Encoding.html#countUTF8Chars"><span class="hs-identifier hs-type">countUTF8Chars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-183"></span><span id="countUTF8Chars"><span class="annot"><span class="annottext">countUTF8Chars :: ShortByteString -&gt; IO Int
</span><a href="GHC.Utils.Encoding.html#countUTF8Chars"><span class="hs-identifier hs-var hs-var">countUTF8Chars</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#SBS"><span class="hs-identifier hs-type">SBS</span></a></span><span> </span><span id="local-6989586621680776961"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680776961"><span class="hs-identifier hs-var">ba</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; IO Int
forall {m :: * -&gt; *}. Monad m =&gt; Int# -&gt; Int# -&gt; m Int
</span><a href="#local-6989586621680776960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span>
</span><span id="line-184"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-185"></span><span>    </span><span id="local-6989586621680776959"><span class="annot"><span class="annottext">len# :: Int#
</span><a href="#local-6989586621680776959"><span class="hs-identifier hs-var hs-var">len#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; Int#
</span><span class="hs-identifier hs-var">sizeofByteArray#</span></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680776961"><span class="hs-identifier hs-var">ba</span></a></span><span>
</span><span id="line-186"></span><span>    </span><span id="local-6989586621680776960"><span class="annot"><span class="annottext">go :: Int# -&gt; Int# -&gt; m Int
</span><a href="#local-6989586621680776960"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621680776956"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776956"><span class="hs-identifier hs-var">i#</span></a></span></span><span> </span><span id="local-6989586621680776955"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776955"><span class="hs-identifier hs-var">n#</span></a></span></span><span>
</span><span id="line-187"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776956"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&gt;=#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776959"><span class="hs-identifier hs-var">len#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-188"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; m Int
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><span class="hs-identifier hs-var">I#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776955"><span class="hs-identifier hs-var">n#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-190"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; Int# -&gt; (# Char#, Int# #)
</span><a href="GHC.Utils.Encoding.html#utf8DecodeCharByteArray%23"><span class="hs-identifier hs-var">utf8DecodeCharByteArray#</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680776961"><span class="hs-identifier hs-var">ba</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776956"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-191"></span><span>            </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">Char#
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776954"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776954"><span class="hs-identifier hs-var">nBytes#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; m Int
</span><a href="#local-6989586621680776960"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776956"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776954"><span class="hs-identifier hs-var">nBytes#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776955"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8EncodeChar"><span class="hs-pragma hs-type">utf8EncodeChar</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-194"></span><span id="local-6989586621680777146"><span class="annot"><a href="GHC.Utils.Encoding.html#utf8EncodeChar"><span class="hs-identifier hs-type">utf8EncodeChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">State#</span></span><span> </span><span class="annot"><a href="#local-6989586621680777146"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">State#</span></span><span> </span><span class="annot"><a href="#local-6989586621680777146"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-195"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680777146"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span></span><span>
</span><span id="line-196"></span><span id="utf8EncodeChar"><span class="annot"><span class="annottext">utf8EncodeChar :: forall s.
(Int# -&gt; Word# -&gt; State# s -&gt; State# s) -&gt; Char -&gt; ST s Int
</span><a href="GHC.Utils.Encoding.html#utf8EncodeChar"><span class="hs-identifier hs-var hs-var">utf8EncodeChar</span></a></span></span><span> </span><span id="local-6989586621680776885"><span class="annot"><span class="annottext">Int# -&gt; Word# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621680776885"><span class="hs-identifier hs-var">write#</span></a></span></span><span> </span><span id="local-6989586621680776884"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776884"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-197"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680776883"><span class="annot"><span class="annottext">x :: Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776884"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-198"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-199"></span><span>    </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x007f</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-200"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var">write</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-201"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; ST s Int
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-202"></span><span>        </span><span class="hs-comment">-- NB. '\0' is encoded as '\xC0\x80', not '\0'.  This is so that we</span><span>
</span><span id="line-203"></span><span>        </span><span class="hs-comment">-- can have 0-terminated UTF-8 strings (see GHC.Base.unpackCStringUtf8).</span><span>
</span><span id="line-204"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x07ff</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-205"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var">write</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0xC0</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x1F</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-206"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var">write</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x80</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x3F</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-207"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; ST s Int
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-208"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0xffff</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-209"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var">write</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0xE0</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">12</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x0F</span></span><span class="hs-special">)</span><span>
</span><span id="line-210"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var">write</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x80</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x3F</span></span><span class="hs-special">)</span><span>
</span><span id="line-211"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var">write</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x80</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x3F</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-212"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; ST s Int
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span>
</span><span id="line-213"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-214"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var">write</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0xF0</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">18</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-215"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var">write</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x80</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">12</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x3F</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-216"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var">write</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x80</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x3F</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-217"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var">write</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x80</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776883"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x3F</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>          </span><span class="annot"><span class="annottext">Int -&gt; ST s Int
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span>
</span><span id="line-219"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-220"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="#local-6989586621680776879"><span class="hs-pragma hs-type">write</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-221"></span><span>    </span><span id="local-6989586621680776879"><span class="annot"><span class="annottext">write :: Int -&gt; Int -&gt; ST s ()
</span><a href="#local-6989586621680776879"><span class="hs-identifier hs-var hs-var">write</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680776875"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776875"><span class="hs-identifier hs-var">off#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680776874"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776874"><span class="hs-identifier hs-var">c#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s () -&gt; ST s ()
forall s a. STRep s a -&gt; ST s a
</span><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s () -&gt; ST s ()) -&gt; STRep s () -&gt; ST s ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680776872"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621680776872"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-222"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Word# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621680776885"><span class="hs-identifier hs-var">write#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776875"><span class="hs-identifier hs-var">off#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><span class="hs-identifier hs-var">int2Word#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776874"><span class="hs-identifier hs-var">c#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621680776872"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-223"></span><span>        </span><span id="local-6989586621680776871"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621680776871"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621680776871"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-224"></span><span>
</span><span id="line-225"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8EncodeString"><span class="hs-identifier hs-type">utf8EncodeString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span id="utf8EncodeString"><span class="annot"><span class="annottext">utf8EncodeString :: Ptr Word8 -&gt; [Char] -&gt; IO ()
</span><a href="GHC.Utils.Encoding.html#utf8EncodeString"><span class="hs-identifier hs-var hs-var">utf8EncodeString</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621680776870"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680776870"><span class="hs-identifier hs-var">a#</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680776869"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776869"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; [Char] -&gt; IO ()
</span><a href="#local-6989586621680776868"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680776870"><span class="hs-identifier hs-var">a#</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776869"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-227"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680776868"><span class="annot"><span class="annottext">go :: Addr# -&gt; [Char] -&gt; IO ()
</span><a href="#local-6989586621680776868"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="annottext">Addr#
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-special">[</span><span class="hs-special">]</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-228"></span><span>        </span><span class="annot"><a href="#local-6989586621680776868"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680776865"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680776865"><span class="hs-identifier hs-var">a#</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776864"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776864"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680776863"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776863"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-229"></span><span>          </span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680776862"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776862"><span class="hs-identifier hs-var">off#</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ST RealWorld Int -&gt; IO Int
forall a. ST RealWorld a -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#stToIO"><span class="hs-identifier hs-var">stToIO</span></a></span><span> </span><span class="annot"><span class="annottext">(ST RealWorld Int -&gt; IO Int) -&gt; ST RealWorld Int -&gt; IO Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Int# -&gt; Word# -&gt; State# RealWorld -&gt; State# RealWorld)
-&gt; Char -&gt; ST RealWorld Int
forall s.
(Int# -&gt; Word# -&gt; State# s -&gt; State# s) -&gt; Char -&gt; ST s Int
</span><a href="GHC.Utils.Encoding.html#utf8EncodeChar"><span class="hs-identifier hs-var">utf8EncodeChar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; Int# -&gt; Word# -&gt; State# RealWorld -&gt; State# RealWorld
forall d. Addr# -&gt; Int# -&gt; Word# -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeWord8OffAddr#</span></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680776865"><span class="hs-identifier hs-var">a#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776864"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-230"></span><span>          </span><span class="annot"><span class="annottext">Addr# -&gt; [Char] -&gt; IO ()
</span><a href="#local-6989586621680776868"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680776865"><span class="hs-identifier hs-var">a#</span></a></span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; Int# -&gt; Addr#
</span><span class="hs-operator hs-var">`plusAddr#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776862"><span class="hs-identifier hs-var">off#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776863"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-231"></span><span>
</span><span id="line-232"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8EncodeShortByteString"><span class="hs-identifier hs-type">utf8EncodeShortByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span>
</span><span id="line-233"></span><span id="utf8EncodeShortByteString"><span class="annot"><span class="annottext">utf8EncodeShortByteString :: [Char] -&gt; IO ShortByteString
</span><a href="GHC.Utils.Encoding.html#utf8EncodeShortByteString"><span class="hs-identifier hs-var hs-var">utf8EncodeShortByteString</span></a></span></span><span> </span><span id="local-6989586621680776860"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776860"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, ShortByteString #))
-&gt; IO ShortByteString
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, ShortByteString #))
 -&gt; IO ShortByteString)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, ShortByteString #))
-&gt; IO ShortByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680776859"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680776859"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-234"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Int
</span><a href="GHC.Utils.Encoding.html#utf8EncodedLength"><span class="hs-identifier hs-var">utf8EncodedLength</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776860"><span class="hs-identifier hs-var">str</span></a></span><span>         </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680776858"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776858"><span class="hs-identifier hs-var">len#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-235"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
-&gt; State# RealWorld
-&gt; (# State# RealWorld, MutableByteArray# RealWorld #)
forall d. Int# -&gt; State# d -&gt; (# State# d, MutableByteArray# d #)
</span><span class="hs-identifier hs-var">newByteArray#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776858"><span class="hs-identifier hs-var">len#</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680776859"><span class="hs-identifier hs-var">s</span></a></span><span>          </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680776857"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680776857"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776856"><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680776856"><span class="hs-identifier hs-var">mba#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-236"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld -&gt; Int# -&gt; [Char] -&gt; ST RealWorld ()
forall {s}. MutableByteArray# s -&gt; Int# -&gt; [Char] -&gt; ST s ()
</span><a href="#local-6989586621680776855"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680776856"><span class="hs-identifier hs-var">mba#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776860"><span class="hs-identifier hs-var">str</span></a></span><span>                </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span id="local-6989586621680776854"><span class="annot"><span class="annottext">STRep RealWorld ()
</span><a href="#local-6989586621680776854"><span class="hs-identifier hs-var">f_go</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-237"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">STRep RealWorld ()
</span><a href="#local-6989586621680776854"><span class="hs-identifier hs-var">f_go</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680776857"><span class="hs-identifier hs-var">s</span></a></span><span>                        </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680776853"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680776853"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-238"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
-&gt; State# RealWorld -&gt; (# State# RealWorld, ByteArray# #)
forall d.
MutableByteArray# d -&gt; State# d -&gt; (# State# d, ByteArray# #)
</span><span class="hs-identifier hs-var">unsafeFreezeByteArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680776856"><span class="hs-identifier hs-var">mba#</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680776853"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680776852"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680776852"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776851"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680776851"><span class="hs-identifier hs-var">ba#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-239"></span><span>  </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680776852"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; ShortByteString
</span><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#SBS"><span class="hs-identifier hs-var">SBS</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680776851"><span class="hs-identifier hs-var">ba#</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-240"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-241"></span><span>    </span><span id="local-6989586621680776855"><span class="annot"><span class="annottext">go :: MutableByteArray# s -&gt; Int# -&gt; [Char] -&gt; ST s ()
</span><a href="#local-6989586621680776855"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; ST s ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-242"></span><span>    </span><span class="annot"><a href="#local-6989586621680776855"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680776848"><span class="annot"><span class="annottext">MutableByteArray# s
</span><a href="#local-6989586621680776848"><span class="hs-identifier hs-var">mba#</span></a></span></span><span> </span><span id="local-6989586621680776847"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776847"><span class="hs-identifier hs-var">i#</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776846"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776846"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680776845"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776845"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-243"></span><span>      </span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680776844"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776844"><span class="hs-identifier hs-var">off#</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Int# -&gt; Word# -&gt; State# s -&gt; State# s) -&gt; Char -&gt; ST s Int
forall s.
(Int# -&gt; Word# -&gt; State# s -&gt; State# s) -&gt; Char -&gt; ST s Int
</span><a href="GHC.Utils.Encoding.html#utf8EncodeChar"><span class="hs-identifier hs-var">utf8EncodeChar</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680776843"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776843"><span class="hs-identifier hs-var">j#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s -&gt; Int# -&gt; Word# -&gt; State# s -&gt; State# s
forall d.
MutableByteArray# d -&gt; Int# -&gt; Word# -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeWord8Array#</span></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s
</span><a href="#local-6989586621680776848"><span class="hs-identifier hs-var">mba#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776847"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776843"><span class="hs-identifier hs-var">j#</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776846"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-244"></span><span>      </span><span class="annot"><span class="annottext">MutableByteArray# s -&gt; Int# -&gt; [Char] -&gt; ST s ()
</span><a href="#local-6989586621680776855"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s
</span><a href="#local-6989586621680776848"><span class="hs-identifier hs-var">mba#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776847"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680776844"><span class="hs-identifier hs-var">off#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776845"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-245"></span><span>
</span><span id="line-246"></span><span class="annot"><a href="GHC.Utils.Encoding.html#utf8EncodedLength"><span class="hs-identifier hs-type">utf8EncodedLength</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-247"></span><span id="utf8EncodedLength"><span class="annot"><span class="annottext">utf8EncodedLength :: [Char] -&gt; Int
</span><a href="GHC.Utils.Encoding.html#utf8EncodedLength"><span class="hs-identifier hs-var hs-var">utf8EncodedLength</span></a></span></span><span> </span><span id="local-6989586621680776842"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776842"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; Int
forall {a}. Num a =&gt; a -&gt; [Char] -&gt; a
</span><a href="#local-6989586621680776841"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776842"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-248"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680776841"><span class="annot"><span class="annottext">go :: a -&gt; [Char] -&gt; a
</span><a href="#local-6989586621680776841"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680776823"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680776823"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680776823"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-249"></span><span>        </span><span class="annot"><a href="#local-6989586621680776841"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680776822"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680776822"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776821"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776821"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680776820"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776820"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-250"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776821"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776821"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x007f</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; [Char] -&gt; a
</span><a href="#local-6989586621680776841"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680776822"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">a
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776820"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-251"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776821"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x07ff</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; [Char] -&gt; a
</span><a href="#local-6989586621680776841"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680776822"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">a
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776820"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-252"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776821"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0xffff</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; [Char] -&gt; a
</span><a href="#local-6989586621680776841"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680776822"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">a
</span><span class="hs-number">3</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776820"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-253"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; [Char] -&gt; a
</span><a href="#local-6989586621680776841"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680776822"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">a
</span><span class="hs-number">4</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776820"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-256"></span><span class="hs-comment">-- The Z-encoding</span><span>
</span><span id="line-257"></span><span>
</span><span id="line-258"></span><span class="hs-comment">{-
This is the main name-encoding and decoding function.  It encodes any
string into a string that is acceptable as a C name.  This is done
right before we emit a symbol name into the compiled C or asm code.
Z-encoding of strings is cached in the FastString interface, so we
never encode the same string more than once.

The basic encoding scheme is this.

* Tuples (,,,) are coded as Z3T

* Alphabetic characters (upper and lower) and digits
        all translate to themselves;
        except 'Z', which translates to 'ZZ'
        and    'z', which translates to 'zz'
  We need both so that we can preserve the variable/tycon distinction

* Most other printable characters translate to 'zx' or 'Zx' for some
        alphabetic character x

* The others translate as 'znnnU' where 'nnn' is the decimal number
        of the character

        Before          After
        --------------------------
        Trak            Trak
        foo_wib         foozuwib
        &gt;               zg
        &gt;1              zg1
        foo#            foozh
        foo##           foozhzh
        foo##1          foozhzh1
        fooZ            fooZZ
        :+              ZCzp
        ()              Z0T     0-tuple
        (,,,,)          Z5T     5-tuple
        (# #)           Z1H     unboxed 1-tuple (note the space)
        (#,,,,#)        Z5H     unboxed 5-tuple
                (NB: There is no Z1T nor Z0H.)
-}</span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span class="hs-keyword">type</span><span> </span><span id="UserString"><span class="annot"><a href="GHC.Utils.Encoding.html#UserString"><span class="hs-identifier hs-var">UserString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>        </span><span class="hs-comment">-- As the user typed it</span><span>
</span><span id="line-300"></span><span class="hs-keyword">type</span><span> </span><span id="EncodedString"><span class="annot"><a href="GHC.Utils.Encoding.html#EncodedString"><span class="hs-identifier hs-var">EncodedString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>     </span><span class="hs-comment">-- Encoded form</span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span>
</span><span id="line-303"></span><span class="annot"><a href="GHC.Utils.Encoding.html#zEncodeString"><span class="hs-identifier hs-type">zEncodeString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#UserString"><span class="hs-identifier hs-type">UserString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#EncodedString"><span class="hs-identifier hs-type">EncodedString</span></a></span><span>
</span><span id="line-304"></span><span id="zEncodeString"><span class="annot"><span class="annottext">zEncodeString :: [Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#zEncodeString"><span class="hs-identifier hs-var hs-var">zEncodeString</span></a></span></span><span> </span><span id="local-6989586621680776817"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776817"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Maybe [Char]
</span><a href="GHC.Utils.Encoding.html#maybe_tuple"><span class="hs-identifier hs-var">maybe_tuple</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776817"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-305"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680776815"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776815"><span class="hs-identifier hs-var">n</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776815"><span class="hs-identifier hs-var">n</span></a></span><span>            </span><span class="hs-comment">-- Tuples go to Z2T etc</span><span>
</span><span id="line-306"></span><span>                </span><span class="annot"><span class="annottext">Maybe [Char]
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="#local-6989586621680776814"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776817"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-307"></span><span>          </span><span class="hs-keyword">where</span><span>
</span><span id="line-308"></span><span>                </span><span id="local-6989586621680776814"><span class="annot"><span class="annottext">go :: [Char] -&gt; [Char]
</span><a href="#local-6989586621680776814"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-309"></span><span>                </span><span class="annot"><a href="#local-6989586621680776814"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776813"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776813"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680776812"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776812"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#encode_digit_ch"><span class="hs-identifier hs-var">encode_digit_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776813"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="#local-6989586621680776810"><span class="hs-identifier hs-var">go'</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776812"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-310"></span><span>                </span><span id="local-6989586621680776810"><span class="annot"><span class="annottext">go' :: [Char] -&gt; [Char]
</span><a href="#local-6989586621680776810"><span class="hs-identifier hs-var hs-var">go'</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-311"></span><span>                </span><span class="annot"><a href="#local-6989586621680776810"><span class="hs-identifier hs-var">go'</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776809"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776809"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680776808"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776808"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776809"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="#local-6989586621680776810"><span class="hs-identifier hs-var">go'</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776808"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span class="annot"><a href="GHC.Utils.Encoding.html#unencodedChar"><span class="hs-identifier hs-type">unencodedChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>   </span><span class="hs-comment">-- True for chars that don't need encoding</span><span>
</span><span id="line-314"></span><span id="unencodedChar"><span class="annot"><span class="annottext">unencodedChar :: Char -&gt; Bool
</span><a href="GHC.Utils.Encoding.html#unencodedChar"><span class="hs-identifier hs-var hs-var">unencodedChar</span></a></span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'Z'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-315"></span><span class="annot"><a href="GHC.Utils.Encoding.html#unencodedChar"><span class="hs-identifier hs-var">unencodedChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'z'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-316"></span><span class="annot"><a href="GHC.Utils.Encoding.html#unencodedChar"><span class="hs-identifier hs-var">unencodedChar</span></a></span><span> </span><span id="local-6989586621680776805"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776805"><span class="hs-identifier hs-var">c</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776805"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'a'</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776805"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'z'</span></span><span>
</span><span id="line-317"></span><span>                  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776805"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'A'</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776805"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'Z'</span></span><span>
</span><span id="line-318"></span><span>                  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776805"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'0'</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776805"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'9'</span></span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span class="hs-comment">-- If a digit is at the start of a symbol then we need to encode it.</span><span>
</span><span id="line-321"></span><span class="hs-comment">-- Otherwise package names like 9pH-0.1 give linker errors.</span><span>
</span><span id="line-322"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_digit_ch"><span class="hs-identifier hs-type">encode_digit_ch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#EncodedString"><span class="hs-identifier hs-type">EncodedString</span></a></span><span>
</span><span id="line-323"></span><span id="encode_digit_ch"><span class="annot"><span class="annottext">encode_digit_ch :: Char -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#encode_digit_ch"><span class="hs-identifier hs-var hs-var">encode_digit_ch</span></a></span></span><span> </span><span id="local-6989586621680776803"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776803"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776803"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'0'</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776803"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'9'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#encode_as_unicode_char"><span class="hs-identifier hs-var">encode_as_unicode_char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776803"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-324"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_digit_ch"><span class="hs-identifier hs-var">encode_digit_ch</span></a></span><span> </span><span id="local-6989586621680776801"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776801"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776801"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-325"></span><span>
</span><span id="line-326"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-type">encode_ch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#EncodedString"><span class="hs-identifier hs-type">EncodedString</span></a></span><span>
</span><span id="line-327"></span><span id="encode_ch"><span class="annot"><span class="annottext">encode_ch :: Char -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var hs-var">encode_ch</span></a></span></span><span> </span><span id="local-6989586621680776800"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776800"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="GHC.Utils.Encoding.html#unencodedChar"><span class="hs-identifier hs-var">unencodedChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776800"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776800"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- Common case first</span><span>
</span><span id="line-328"></span><span>
</span><span id="line-329"></span><span class="hs-comment">-- Constructors</span><span>
</span><span id="line-330"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;ZL&quot;</span></span><span>   </span><span class="hs-comment">-- Needed for things like (,), and (-&gt;)</span><span>
</span><span id="line-331"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">')'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;ZR&quot;</span></span><span>   </span><span class="hs-comment">-- For symmetry with (</span><span>
</span><span id="line-332"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'['</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;ZM&quot;</span></span><span>
</span><span id="line-333"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">']'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;ZN&quot;</span></span><span>
</span><span id="line-334"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">':'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;ZC&quot;</span></span><span>
</span><span id="line-335"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'Z'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;ZZ&quot;</span></span><span>
</span><span id="line-336"></span><span>
</span><span id="line-337"></span><span class="hs-comment">-- Variables</span><span>
</span><span id="line-338"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'z'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zz&quot;</span></span><span>
</span><span id="line-339"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&amp;'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;za&quot;</span></span><span>
</span><span id="line-340"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'|'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zb&quot;</span></span><span>
</span><span id="line-341"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'^'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zc&quot;</span></span><span>
</span><span id="line-342"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'$'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zd&quot;</span></span><span>
</span><span id="line-343"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'='</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;ze&quot;</span></span><span>
</span><span id="line-344"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&gt;'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zg&quot;</span></span><span>
</span><span id="line-345"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'#'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zh&quot;</span></span><span>
</span><span id="line-346"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'.'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zi&quot;</span></span><span>
</span><span id="line-347"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&lt;'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zl&quot;</span></span><span>
</span><span id="line-348"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'-'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zm&quot;</span></span><span>
</span><span id="line-349"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'!'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zn&quot;</span></span><span>
</span><span id="line-350"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'+'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zp&quot;</span></span><span>
</span><span id="line-351"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\''</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zq&quot;</span></span><span>
</span><span id="line-352"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zr&quot;</span></span><span>
</span><span id="line-353"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'/'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zs&quot;</span></span><span>
</span><span id="line-354"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'*'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zt&quot;</span></span><span>
</span><span id="line-355"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'_'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zu&quot;</span></span><span>
</span><span id="line-356"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'%'</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;zv&quot;</span></span><span>
</span><span id="line-357"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_ch"><span class="hs-identifier hs-var">encode_ch</span></a></span><span> </span><span id="local-6989586621680776799"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776799"><span class="hs-identifier hs-var">c</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#encode_as_unicode_char"><span class="hs-identifier hs-var">encode_as_unicode_char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776799"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-358"></span><span>
</span><span id="line-359"></span><span class="annot"><a href="GHC.Utils.Encoding.html#encode_as_unicode_char"><span class="hs-identifier hs-type">encode_as_unicode_char</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#EncodedString"><span class="hs-identifier hs-type">EncodedString</span></a></span><span>
</span><span id="line-360"></span><span id="encode_as_unicode_char"><span class="annot"><span class="annottext">encode_as_unicode_char :: Char -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#encode_as_unicode_char"><span class="hs-identifier hs-var hs-var">encode_as_unicode_char</span></a></span></span><span> </span><span id="local-6989586621680776798"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776798"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'z'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isDigit"><span class="hs-identifier hs-var">isDigit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; Char
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776795"><span class="hs-identifier hs-var">hex_str</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776795"><span class="hs-identifier hs-var">hex_str</span></a></span><span>
</span><span id="line-361"></span><span>                                                           </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'0'</span></span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776795"><span class="hs-identifier hs-var">hex_str</span></a></span><span>
</span><span id="line-362"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680776795"><span class="annot"><span class="annottext">hex_str :: [Char]
</span><a href="#local-6989586621680776795"><span class="hs-identifier hs-var hs-var">hex_str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; [Char]
forall a. (Integral a, Show a) =&gt; a -&gt; [Char] -&gt; [Char]
</span><a href="../../base/src/Numeric.html#showHex"><span class="hs-identifier hs-var">showHex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776798"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;U&quot;</span></span><span>
</span><span id="line-363"></span><span>  </span><span class="hs-comment">-- ToDo: we could improve the encoding here in various ways.</span><span>
</span><span id="line-364"></span><span>  </span><span class="hs-comment">-- eg. strings of unicode characters come out as 'z1234Uz5678U', we</span><span>
</span><span id="line-365"></span><span>  </span><span class="hs-comment">-- could remove the 'U' in the middle (the 'z' works as a separator).</span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span class="annot"><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-type">zDecodeString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#EncodedString"><span class="hs-identifier hs-type">EncodedString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#UserString"><span class="hs-identifier hs-type">UserString</span></a></span><span>
</span><span id="line-368"></span><span id="zDecodeString"><span class="annot"><span class="annottext">zDecodeString :: [Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var hs-var">zDecodeString</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-369"></span><span class="annot"><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'Z'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776790"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776790"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776789"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776789"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-370"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isDigit"><span class="hs-identifier hs-var">isDigit</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776790"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#decode_tuple"><span class="hs-identifier hs-var">decode_tuple</span></a></span><span>   </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776790"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776789"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-371"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="GHC.Utils.Encoding.html#decode_upper"><span class="hs-identifier hs-var">decode_upper</span></a></span><span>   </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776790"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776789"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-372"></span><span class="annot"><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'z'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776786"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776786"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776785"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776785"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isDigit"><span class="hs-identifier hs-var">isDigit</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776786"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#decode_num_esc"><span class="hs-identifier hs-var">decode_num_esc</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776786"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776785"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-374"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span>   </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776786"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776785"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-375"></span><span class="annot"><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776782"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776782"><span class="hs-identifier hs-var">c</span></a></span></span><span>   </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776781"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776781"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776782"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776781"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_upper"><span class="hs-identifier hs-type">decode_upper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-type">decode_lower</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span id="decode_upper"><span class="annot"><span class="annottext">decode_upper :: Char -&gt; Char
</span><a href="GHC.Utils.Encoding.html#decode_upper"><span class="hs-identifier hs-var hs-var">decode_upper</span></a></span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'L'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span>
</span><span id="line-380"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_upper"><span class="hs-identifier hs-var">decode_upper</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'R'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">')'</span></span><span>
</span><span id="line-381"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_upper"><span class="hs-identifier hs-var">decode_upper</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'M'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'['</span></span><span>
</span><span id="line-382"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_upper"><span class="hs-identifier hs-var">decode_upper</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'N'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">']'</span></span><span>
</span><span id="line-383"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_upper"><span class="hs-identifier hs-var">decode_upper</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'C'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">':'</span></span><span>
</span><span id="line-384"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_upper"><span class="hs-identifier hs-var">decode_upper</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'Z'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'Z'</span></span><span>
</span><span id="line-385"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_upper"><span class="hs-identifier hs-var">decode_upper</span></a></span><span> </span><span id="local-6989586621680776780"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776780"><span class="hs-identifier hs-var">ch</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">{-pprTrace &quot;decode_upper&quot; (char ch)-}</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776780"><span class="hs-identifier hs-var">ch</span></a></span><span>
</span><span id="line-386"></span><span>
</span><span id="line-387"></span><span id="decode_lower"><span class="annot"><span class="annottext">decode_lower :: Char -&gt; Char
</span><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var hs-var">decode_lower</span></a></span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'z'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'z'</span></span><span>
</span><span id="line-388"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'a'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&amp;'</span></span><span>
</span><span id="line-389"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'b'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'|'</span></span><span>
</span><span id="line-390"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'c'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'^'</span></span><span>
</span><span id="line-391"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'d'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'$'</span></span><span>
</span><span id="line-392"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'e'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'='</span></span><span>
</span><span id="line-393"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'g'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&gt;'</span></span><span>
</span><span id="line-394"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'h'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'#'</span></span><span>
</span><span id="line-395"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'i'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'.'</span></span><span>
</span><span id="line-396"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'l'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&lt;'</span></span><span>
</span><span id="line-397"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'m'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'-'</span></span><span>
</span><span id="line-398"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'n'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'!'</span></span><span>
</span><span id="line-399"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'p'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'+'</span></span><span>
</span><span id="line-400"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'q'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\''</span></span><span>
</span><span id="line-401"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'r'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span>
</span><span id="line-402"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'s'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'/'</span></span><span>
</span><span id="line-403"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'t'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'*'</span></span><span>
</span><span id="line-404"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'u'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'_'</span></span><span>
</span><span id="line-405"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'v'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'%'</span></span><span>
</span><span id="line-406"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_lower"><span class="hs-identifier hs-var">decode_lower</span></a></span><span> </span><span id="local-6989586621680776779"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776779"><span class="hs-identifier hs-var">ch</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">{-pprTrace &quot;decode_lower&quot; (char ch)-}</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776779"><span class="hs-identifier hs-var">ch</span></a></span><span>
</span><span id="line-407"></span><span>
</span><span id="line-408"></span><span class="hs-comment">-- Characters not having a specific code are coded as z224U (in hex)</span><span>
</span><span id="line-409"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_num_esc"><span class="hs-identifier hs-type">decode_num_esc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#EncodedString"><span class="hs-identifier hs-type">EncodedString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#UserString"><span class="hs-identifier hs-type">UserString</span></a></span><span>
</span><span id="line-410"></span><span id="decode_num_esc"><span class="annot"><span class="annottext">decode_num_esc :: Char -&gt; [Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#decode_num_esc"><span class="hs-identifier hs-var hs-var">decode_num_esc</span></a></span></span><span> </span><span id="local-6989586621680776778"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776778"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621680776777"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776777"><span class="hs-identifier hs-var">rest</span></a></span></span><span>
</span><span id="line-411"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; [Char]
</span><a href="#local-6989586621680776776"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/Data.Char.html#digitToInt"><span class="hs-identifier hs-var">digitToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776778"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776777"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-412"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-413"></span><span>    </span><span id="local-6989586621680776776"><span class="annot"><span class="annottext">go :: Int -&gt; [Char] -&gt; [Char]
</span><a href="#local-6989586621680776776"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621680776768"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776768"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776767"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776767"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776766"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776766"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isHexDigit"><span class="hs-identifier hs-var">isHexDigit</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776767"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; [Char]
</span><a href="#local-6989586621680776776"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">16</span></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776768"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/Data.Char.html#digitToInt"><span class="hs-identifier hs-var">digitToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776767"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776766"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-414"></span><span>    </span><span class="annot"><a href="#local-6989586621680776776"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680776763"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776763"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'U'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776762"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776762"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="../../base/src/GHC.Char.html#chr"><span class="hs-identifier hs-var">chr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776763"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776762"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-415"></span><span>    </span><span class="annot"><a href="#local-6989586621680776776"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680776760"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776760"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680776759"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776759"><span class="hs-identifier hs-var">other</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
forall a. HasCallStack =&gt; [Char] -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;decode_num_esc: &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776760"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>  </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776759"><span class="hs-identifier hs-var">other</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-416"></span><span>
</span><span id="line-417"></span><span class="annot"><a href="GHC.Utils.Encoding.html#decode_tuple"><span class="hs-identifier hs-type">decode_tuple</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#EncodedString"><span class="hs-identifier hs-type">EncodedString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#UserString"><span class="hs-identifier hs-type">UserString</span></a></span><span>
</span><span id="line-418"></span><span id="decode_tuple"><span class="annot"><span class="annottext">decode_tuple :: Char -&gt; [Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#decode_tuple"><span class="hs-identifier hs-var hs-var">decode_tuple</span></a></span></span><span> </span><span id="local-6989586621680776756"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776756"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621680776755"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776755"><span class="hs-identifier hs-var">rest</span></a></span></span><span>
</span><span id="line-419"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; [Char]
</span><a href="#local-6989586621680776754"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/Data.Char.html#digitToInt"><span class="hs-identifier hs-var">digitToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776756"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776755"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-420"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-421"></span><span>        </span><span class="hs-comment">-- NB. recurse back to zDecodeString after decoding the tuple, because</span><span>
</span><span id="line-422"></span><span>        </span><span class="hs-comment">-- the tuple might be embedded in a longer name.</span><span>
</span><span id="line-423"></span><span>    </span><span id="local-6989586621680776754"><span class="annot"><span class="annottext">go :: Int -&gt; [Char] -&gt; [Char]
</span><a href="#local-6989586621680776754"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621680776739"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776739"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776738"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776738"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776737"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776737"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isDigit"><span class="hs-identifier hs-var">isDigit</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776738"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; [Char]
</span><a href="#local-6989586621680776754"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776739"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/Data.Char.html#digitToInt"><span class="hs-identifier hs-var">digitToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776738"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776737"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-424"></span><span>    </span><span class="annot"><a href="#local-6989586621680776754"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'T'</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680776736"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776736"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;()&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776736"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-425"></span><span>    </span><span class="annot"><a href="#local-6989586621680776754"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680776735"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776735"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'T'</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680776734"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776734"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; [Char]
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776735"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">','</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;)&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776734"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-426"></span><span>    </span><span class="annot"><a href="#local-6989586621680776754"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'H'</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680776732"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776732"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;(# #)&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776732"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-427"></span><span>    </span><span class="annot"><a href="#local-6989586621680776754"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680776731"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776731"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'H'</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680776730"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776730"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'#'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; [Char]
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776731"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">','</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;#)&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#zDecodeString"><span class="hs-identifier hs-var">zDecodeString</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776730"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-428"></span><span>    </span><span class="annot"><a href="#local-6989586621680776754"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680776729"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776729"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680776728"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776728"><span class="hs-identifier hs-var">other</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
forall a. HasCallStack =&gt; [Char] -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;decode_tuple: &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776729"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776728"><span class="hs-identifier hs-var">other</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-429"></span><span>
</span><span id="line-430"></span><span class="hs-comment">{-
Tuples are encoded as
        Z3T or Z3H
for 3-tuples or unboxed 3-tuples respectively.  No other encoding starts
        Z&lt;digit&gt;

* &quot;(# #)&quot; is the tycon for an unboxed 1-tuple (not 0-tuple)
  There are no unboxed 0-tuples.

* &quot;()&quot; is the tycon for a boxed 0-tuple.
  There are no boxed 1-tuples.
-}</span><span>
</span><span id="line-442"></span><span>
</span><span id="line-443"></span><span class="annot"><a href="GHC.Utils.Encoding.html#maybe_tuple"><span class="hs-identifier hs-type">maybe_tuple</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#UserString"><span class="hs-identifier hs-type">UserString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html#EncodedString"><span class="hs-identifier hs-type">EncodedString</span></a></span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span id="maybe_tuple"><span class="annot"><span class="annottext">maybe_tuple :: [Char] -&gt; Maybe [Char]
</span><a href="GHC.Utils.Encoding.html#maybe_tuple"><span class="hs-identifier hs-var hs-var">maybe_tuple</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;(# #)&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Maybe [Char]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Z1H&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-446"></span><span class="annot"><a href="GHC.Utils.Encoding.html#maybe_tuple"><span class="hs-identifier hs-var">maybe_tuple</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'#'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776727"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776727"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; (Int, [Char])
</span><a href="GHC.Utils.Encoding.html#count_commas"><span class="hs-identifier hs-var">count_commas</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-glyph">::</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776727"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-447"></span><span>                                 </span><span class="hs-special">(</span><span id="local-6989586621680776725"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776725"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'#'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">')'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Maybe [Char]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'Z'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char] -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#shows"><span class="hs-identifier hs-var">shows</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776725"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;H&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-448"></span><span>                                 </span><span class="annot"><span class="annottext">(Int, [Char])
</span><span class="hs-identifier">_</span></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe [Char]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-449"></span><span class="annot"><a href="GHC.Utils.Encoding.html#maybe_tuple"><span class="hs-identifier hs-var">maybe_tuple</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;()&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Maybe [Char]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Z0T&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-450"></span><span class="annot"><a href="GHC.Utils.Encoding.html#maybe_tuple"><span class="hs-identifier hs-var">maybe_tuple</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776723"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776723"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; (Int, [Char])
</span><a href="GHC.Utils.Encoding.html#count_commas"><span class="hs-identifier hs-var">count_commas</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-glyph">::</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776723"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-451"></span><span>                                 </span><span class="hs-special">(</span><span id="local-6989586621680776722"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776722"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">')'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Maybe [Char]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'Z'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char] -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#shows"><span class="hs-identifier hs-var">shows</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776722"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;T&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-452"></span><span>                                 </span><span class="annot"><span class="annottext">(Int, [Char])
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe [Char]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-453"></span><span class="annot"><a href="GHC.Utils.Encoding.html#maybe_tuple"><span class="hs-identifier hs-var">maybe_tuple</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-identifier">_</span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe [Char]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-454"></span><span>
</span><span id="line-455"></span><span class="annot"><a href="GHC.Utils.Encoding.html#count_commas"><span class="hs-identifier hs-type">count_commas</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-456"></span><span id="count_commas"><span class="annot"><span class="annottext">count_commas :: Int -&gt; [Char] -&gt; (Int, [Char])
</span><a href="GHC.Utils.Encoding.html#count_commas"><span class="hs-identifier hs-var hs-var">count_commas</span></a></span></span><span> </span><span id="local-6989586621680776721"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776721"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">','</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680776720"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776720"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char] -&gt; (Int, [Char])
</span><a href="GHC.Utils.Encoding.html#count_commas"><span class="hs-identifier hs-var">count_commas</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776721"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776720"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-457"></span><span class="annot"><a href="GHC.Utils.Encoding.html#count_commas"><span class="hs-identifier hs-var">count_commas</span></a></span><span> </span><span id="local-6989586621680776719"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776719"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680776718"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776718"><span class="hs-identifier hs-var">cs</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776719"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776718"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-458"></span><span>
</span><span id="line-459"></span><span>
</span><span id="line-460"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                        Base 62
*                                                                      *
************************************************************************

Note [Base 62 encoding 128-bit integers]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Instead of base-62 encoding a single 128-bit integer
(ceil(21.49) characters), we'll base-62 a pair of 64-bit integers
(2 * ceil(10.75) characters).  Luckily for us, it's the same number of
characters!
-}</span><span>
</span><span id="line-474"></span><span>
</span><span id="line-475"></span><span class="hs-comment">--------------------------------------------------------------------------</span><span>
</span><span id="line-476"></span><span class="hs-comment">-- Base 62</span><span>
</span><span id="line-477"></span><span>
</span><span id="line-478"></span><span class="hs-comment">-- The base-62 code is based off of 'locators'</span><span>
</span><span id="line-479"></span><span class="hs-comment">-- ((c) Operational Dynamics Consulting, BSD3 licensed)</span><span>
</span><span id="line-480"></span><span>
</span><span id="line-481"></span><span class="hs-comment">-- | Size of a 64-bit word when written as a base-62 string</span><span>
</span><span id="line-482"></span><span class="annot"><a href="GHC.Utils.Encoding.html#word64Base62Len"><span class="hs-identifier hs-type">word64Base62Len</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-483"></span><span id="word64Base62Len"><span class="annot"><span class="annottext">word64Base62Len :: Int
</span><a href="GHC.Utils.Encoding.html#word64Base62Len"><span class="hs-identifier hs-var hs-var">word64Base62Len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">11</span></span><span>
</span><span id="line-484"></span><span>
</span><span id="line-485"></span><span class="hs-comment">-- | Converts a 64-bit word into a base-62 string</span><span>
</span><span id="line-486"></span><span class="annot"><a href="GHC.Utils.Encoding.html#toBase62Padded"><span class="hs-identifier hs-type">toBase62Padded</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-487"></span><span id="toBase62Padded"><span class="annot"><span class="annottext">toBase62Padded :: Word64 -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#toBase62Padded"><span class="hs-identifier hs-var hs-var">toBase62Padded</span></a></span></span><span> </span><span id="local-6989586621680776716"><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621680776716"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776715"><span class="hs-identifier hs-var">pad</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776714"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-488"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-489"></span><span>    </span><span id="local-6989586621680776715"><span class="annot"><span class="annottext">pad :: [Char]
</span><a href="#local-6989586621680776715"><span class="hs-identifier hs-var hs-var">pad</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; [Char]
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776713"><span class="hs-identifier hs-var">len</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'0'</span></span><span>
</span><span id="line-490"></span><span>    </span><span id="local-6989586621680776713"><span class="annot"><span class="annottext">len :: Int
</span><a href="#local-6989586621680776713"><span class="hs-identifier hs-var hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Utils.Encoding.html#word64Base62Len"><span class="hs-identifier hs-var">word64Base62Len</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776714"><span class="hs-identifier hs-var">str</span></a></span><span> </span><span class="hs-comment">-- 11 == ceil(64 / lg 62)</span><span>
</span><span id="line-491"></span><span>    </span><span id="local-6989586621680776714"><span class="annot"><span class="annottext">str :: [Char]
</span><a href="#local-6989586621680776714"><span class="hs-identifier hs-var hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#toBase62"><span class="hs-identifier hs-var">toBase62</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621680776716"><span class="hs-identifier hs-var">w</span></a></span><span>
</span><span id="line-492"></span><span>
</span><span id="line-493"></span><span class="annot"><a href="GHC.Utils.Encoding.html#toBase62"><span class="hs-identifier hs-type">toBase62</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-494"></span><span id="toBase62"><span class="annot"><span class="annottext">toBase62 :: Word64 -&gt; [Char]
</span><a href="GHC.Utils.Encoding.html#toBase62"><span class="hs-identifier hs-var hs-var">toBase62</span></a></span></span><span> </span><span id="local-6989586621680776708"><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621680776708"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; (Int -&gt; Char) -&gt; Word64 -&gt; [Char] -&gt; [Char]
forall a.
(Integral a, Show a) =&gt;
a -&gt; (Int -&gt; Char) -&gt; a -&gt; [Char] -&gt; [Char]
</span><a href="../../base/src/Numeric.html#showIntAtBase"><span class="hs-identifier hs-var">showIntAtBase</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><span class="hs-number">62</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="#local-6989586621680776706"><span class="hs-identifier hs-var">represent</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621680776708"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-495"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-496"></span><span>    </span><span class="annot"><a href="#local-6989586621680776706"><span class="hs-identifier hs-type">represent</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span>
</span><span id="line-497"></span><span>    </span><span id="local-6989586621680776706"><span class="annot"><span class="annottext">represent :: Int -&gt; Char
</span><a href="#local-6989586621680776706"><span class="hs-identifier hs-var hs-var">represent</span></a></span></span><span> </span><span id="local-6989586621680776705"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776705"><span class="hs-identifier hs-var">x</span></a></span></span><span>
</span><span id="line-498"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776705"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="../../base/src/GHC.Char.html#chr"><span class="hs-identifier hs-var">Char.chr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">48</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776705"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-499"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776705"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">36</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="../../base/src/GHC.Char.html#chr"><span class="hs-identifier hs-var">Char.chr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">65</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776705"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span class="hs-special">)</span><span>
</span><span id="line-500"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776705"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">62</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="../../base/src/GHC.Char.html#chr"><span class="hs-identifier hs-var">Char.chr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">97</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776705"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">36</span></span><span class="hs-special">)</span><span>
</span><span id="line-501"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Char
forall a. HasCallStack =&gt; [Char] -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;represent (base 62): impossible!&quot;</span></span><span>
</span><span id="line-502"></span></pre></body></html>